<% if request.delete? %>
$("#member-<%= @member.id %>").remove();
<% else %>
$("#member-<%= @member.id %>").replaceWith("<%= j(render('member', member: @member)) %>");
<% end %>